import request from '@/utils/request'
import requestNew from "@/utils/requestNew";

export function upload(data) {
  return request({
    url: '/system/resource/profile/upload',
    method: 'post',
    data: data
  })
}

// 总包合同汇总信息
export function getStatisticsByMutiDept(bfbms) {
  return request({
    url: '/contract/contract/getStatisticsByMutiDept/'+bfbms,
    method: 'get',
  })
}

// 添加总包合同汇总信息
export function getStatisticsForAdd(bfbm) {
  return request({
    url: '/contract/contract/getStatisticsForAdd/'+bfbm,
    method: 'get',
  })
}

// 生成pdf
export function newfile(contractId) {
  return request({
    url: '/contract/contract/newfile/'+contractId,
    method: 'get',
  })
}

// 附着物信息分类统计
export function listStatisticsIncludeQingMiao(dkbm) {
  return request({
    url: '/accounting/item/listStatisticsIncludeQingMiao?dkbm='+dkbm,
    method: 'get',
  })
}

export function approvalList(query) {
  return request({
    url: '/contract/approval/list',
    method: 'get',
    params: query
  })
}
// 变更历史记录
export function changeList(query) {
  return request({
    url: '/contract/change/list',
    method: 'get',
    params: query
  })
}
// 变更历史记录明细
export function changeDetails(contractChangeId) {
  return request({
    url: '/contract/change/'+contractChangeId,
    method: 'get',
  })
}

export function getCode() {
  return request({
    url: '/contract/contract/code',
    method: 'get',
  })
}

// 查询【请填写功能名称】列表
export function listCBHT(query) {
  return request({
    url: '/contract/contract/list',
    method: 'get',
    params: query
  })
}

export function operationLog(query) {
  return request({
    url: '/contract/operationLog/list',
    method: 'get',
    params: query
  })
}

export function operationLogList(query) {
  return request({
    url: '/contract/operationLog/list',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getCBHT(id) {
  return request({
    url: '/contract/contract/getMoreDetailedInfo/' + id,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addCBHT(data) {
  return requestNew({
    url: '/contract/contract/',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateCBHT(data) {
  return requestNew({
    url: '/contract/contract/',
    method: 'put',
    data: data
  })
}

// 提交
export function submitCBHT(data) {
  return request({
    url: '/contract/contract/submit',
    method: 'put',
    data: data
  })
}

// 更新附件
export function updateContractAttachment(data) {
  return request({
    url: '/contract/contract/updateContractAttachment',
    method: 'put',
    data: data
  })
}

//变更
export function updateChange(data) {
  return request({
    url: '/contract/contract/change',
    method: 'put',
    data: data
  })
}

//终止
export function stop(data) {
  return request({
    url: '/contract/contract/stop',
    method: 'put',
    data: data
  })
}

// 审批通过
export function approvalPassStatistics(data) {
  return request({
    url: '/contract/contract/approvalpassStatistics',
    method: 'put',
    data: data
  })
}

// 审批驳回
export function approvalNoStatistics(data) {
  return request({
    url: '/contract/contract/approvalNoStatistics',
    method: 'put',
    data: data
  })
}

// 审批通过
export function approvalPass(data) {
  return request({
    url: '/contract/contract/approvalPass',
    method: 'put',
    data: data
  })
}

// 审批驳回
export function approvalNo(data) {
  return request({
    url: '/contract/contract/approvalNo',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delCBHT(id) {
  return request({
    url: '/contract/contract/' + id,
    method: 'delete'
  })
}

export function remove(id) {
  return request({
    url: '/contract/contract/remove/' + id,
    method: 'delete'
  })
}

// 导出【请填写功能名称】
export function exportCBHT(query) {
  return request({
    url: '/system/CBHT/export',
    method: 'get',
    params: query
  })
}

// 总包方
export function addStatistics(data) {
  return request({
    url: '/contract/contract/addStatistics',
    method: 'post',
    data: data
  })
}

export function editStatistics(data) {
  return request({
    url: '/contract/contract/editStatistics',
    method: 'put',
    data: data
  })
}
